package cn.ekuma.data.ui.android.editor;

import android.view.View;

import com.openbravo.data.user.BrowsableEditableDataModel;
import com.openbravo.data.user.I_AndroidBrowsableEditableData;

import cn.ekuma.data.dao.bean.I_BaseBean;
import cn.ekuma.data.ui.android.BeanFindPanel;
import cn.ekuma.data.ui.android.OnBaseBeanSelectedListener;

/**
 * Created by Administrator on 2014/12/11.
 */
public abstract class AbstractListPageEditorActivate<T extends I_BaseBean> extends  AbstractPageEditorActivate<T> {

    @Override
    public View getJListPage(I_AndroidBrowsableEditableData m_db, OnBaseBeanSelectedListener objSelectedListener) {
        BrowsableEditableDataAdapter adapter  = new BrowsableEditableDataAdapter(this.getBaseContext(),m_db,this);
        BeanFindPanel findPanel=new BeanFindPanel(this.getBaseContext(),this,adapter);
        findPanel.setOnBaseBeanSelectedListener(objSelectedListener);
        return findPanel;
    }

    @Override
    protected I_AndroidBrowsableEditableData getBrowsableEditableData() {
        return new BrowsableEditableDataModel(getDataLogic(),getSuportClass(), getEditor(), dirty);
    }

    public abstract Class getSuportClass();
}
